//
//  MTool.h
//  BMW
//
//  Created by up72-2 on 15/10/26.
//  Copyright © 2015年 up72-2. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface MTool : NSObject

//转化为json字符串
+ (NSString *)DataTOjsonString:(id)object;

//json字符串转化为字典
+ (NSMutableDictionary *)jsonStringToDictionary:(NSString *)jsonStr;

//alert提示
+ (void)showMessage:(NSString *)message inView:(UIView *)view;

+ (CGSize)sizeWithText:(NSString *)text font:(UIFont *)font constrainedToSize:(CGSize)size;

+(NSData*)returnDataWithDictionary:(NSMutableDictionary*)dict;
+(NSMutableDictionary *)returnDictionaryWithDataPath:(NSData *)data;

+ (void)deleteFileWithPath:(NSString *)path;

//正则校验
+ (BOOL)checkTel:(NSString *)telephone;
+ (BOOL)validateEmail:(NSString *)email;
+ (BOOL)validateIdentityName: (NSString *)name;

+ (BOOL)storeCurrentUserName:(NSString *)userName;
+ (NSString *)getUserName;

+ (BOOL)storeCurrentData:(NSDictionary *)dic;
+ (NSDictionary *)getCurrentData;

+ (BOOL)storeCurrentState:(NSString *)state;
+ (NSString *)getState;
@end
